home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 4 / CDPD_IV.bin / e / mailinglists / amigae.0294feb.archive / 000023_donews!crash!m….msus.edu!platt_Tue, 8 Feb 94 07:37:01 PST.msg < prev    next >
Internet Message Format  |  1994-05-26  |  4KB

  1. Received: by bkhouse.cts.com (V1.17-beta/Amiga)
  2.       id <1r4k@bkhouse.cts.com>; Tue, 8 Feb 94 07:37:01 PST
  3. Received: from crash by donews.cts.com with uucp
  4.     (Smail3.1.28.1 #18) id m0pTeGI-0001qKC; Mon, 7 Feb 94 14:16 PST
  5. Received: from mhd1.moorhead.msus.edu by crash.cts.com with smtp
  6.     (Smail3.1.28.1 #18) id m0pSuzm-0000O8C; Sat, 5 Feb 94 13:56 PST
  7. Received: by mhd1.moorhead.msus.edu (5.65/DEC-Ultrix/4.3)
  8.     id AA15695; Sat, 5 Feb 1994 15:57:47 -0600
  9. Message-Id: <9402052157.AA15695@mhd1.moorhead.msus.edu>
  10. Date: Sat, 5 Feb 1994 15:57:47 -0600 (CST)
  11. X-Mailer: ELM [version 2.4 PL20]
  12. Content-Type: text
  13. Content-Length: 2865
  14. From: platt@mhd1.moorhead.msus.edu (Vincent Platt)
  15. To: amigae@bkhouse.cts.com (amigae)
  16. Subject: AppIcon.e
  17.  
  18. Yes!!! I did it.  I found that in order to read the names of the objects
  19. dropped on an AppIcon you have to reference a wbarg structure at arglist
  20. in the appmessage structure.  (Errrkkk!!)  Thanks to my friends includes I
  21. figured this out.  So it wasn't a bug in E, but durn close.
  22.  
  23. Here's the completely functioning source for a 100% (not yet) usable AppIcon.
  24.  
  25. OPT OSVERSION=37
  26.  
  27. /* The following MODULE statements come from EPP.  EPP came up with these
  28. statements given the following PMODULE statements:
  29.  
  30. PMODULE 'eheaders:exec/types'
  31. PMODULE 'eheaders:workbench/workbench'
  32. PMODULE 'eheaders:workbench/startup'
  33. PMODULE 'eheaders:exec/libraries'
  34. */
  35.  
  36.  
  37. MODULE 'exec/types'
  38. MODULE 'exec/nodes'
  39. MODULE 'exec/lists'
  40. MODULE 'exec/tasks'
  41. MODULE 'graphics/gfx'
  42. MODULE 'exec/ports'
  43. MODULE 'exec/semaphores'
  44. MODULE 'utility/hooks'
  45. MODULE 'graphics/clip'
  46. MODULE 'graphics/copper'
  47. MODULE 'graphics/gfxnodes'
  48. MODULE 'graphics/monitor'
  49. MODULE 'hardware/custom'
  50. MODULE 'graphics/view'
  51. MODULE 'graphics/rastport'
  52. MODULE 'graphics/layers'
  53. MODULE 'utility/tagitem'
  54. MODULE 'graphics/text'
  55. MODULE 'exec/io'
  56. MODULE 'devices/serial'
  57. MODULE 'devices/inputevent'
  58. MODULE 'intuition/intuition'
  59. MODULE 'workbench/workbench'
  60. MODULE 'dos/dos'
  61. MODULE 'workbench/startup'
  62. MODULE 'exec/libraries'
  63. MODULE 'icon'
  64. MODULE 'wb'
  65.  
  66. DEF appmsg:PTR TO appmessage
  67. DEF args:PTR TO wbarg
  68.  
  69. DEF dropcount
  70. DEF x
  71. DEF dobj:PTR TO diskobject
  72. DEF myport:PTR TO mp
  73. DEF appcon:PTR TO appicon
  74.  
  75. PROC main()
  76.  
  77.     IF (iconbase:=OpenLibrary('icon.library',37))
  78.     IF (workbenchbase:=OpenLibrary('workbench.library',37))
  79.       IF (dobj:=GetDefDiskObject(WBDISK))
  80.         dobj.type=NIL
  81.         IF (myport:=CreateMsgPort())
  82.           IF (appcon:=AddAppIconA(NIL,NIL,'TestAppIcon',myport,NIL,dobj,NIL))
  83.             dropcount:=0
  84.             WriteF('Drop files on the AppIcon.\n')
  85.             WriteF('Example exits after 3 drops.\n')
  86.  
  87.             WHILE dropcount < 3
  88.               WaitPort(myport)
  89.               WHILE appmsg:=GetMsg(myport)
  90.                 IF appmsg.numargs = 0
  91.                   WriteF('User activated the AppIcon.\nA window here would be nice.\n')
  92.                 ELSEIF appmsg.numargs>0
  93.                   WriteF('User dropped \d icons on the AppIcon.\n',appmsg.numargs)
  94.                   args:=appmsg.arglist
  95.                   FOR x:= 1 TO appmsg.numargs
  96.                      WriteF('#\d name = "\s"\n',x,args[].name++)
  97.                   ENDFOR
  98.                 ENDIF
  99.                 ReplyMsg(appmsg)
  100.               ENDWHILE
  101.               INC dropcount
  102.             ENDWHILE
  103.             RemoveAppIcon(appcon)
  104.             WHILE appmsg:=GetMsg(myport)
  105.               ReplyMsg(appmsg)
  106.             ENDWHILE
  107.             DeleteMsgPort(myport)
  108.             FreeDiskObject(dobj)
  109.             CloseLibrary(workbenchbase)
  110.             CloseLibrary(iconbase)
  111.           ENDIF
  112.         ENDIF
  113.       ENDIF
  114.     ENDIF
  115.   ENDIF
  116. ENDPROC